import requests,time

urlList = []
urlFall = []

headers = {

    "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
}

with open('/Users/kenblock/Desktop/url.csv','r',encoding='utf-8') as csvFile:

    line = csvFile.readlines()

    for i in line:
        urlList.append(i)


    for i in urlList:
        time.sleep(1)
        response = requests.get(i,headers=headers)

        if response.status_code != 200:
            urlFall.append(i)
            print(i+"\t 状态吗："+str(response.status_code))


    with open('urlFalse.csv','a',encoding='utf-8') as urlNo:

        urlNo.writelines(urlFall)
